package com.example.demo.mapper;
import com.example.demo.entity.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface OrderMapper {

//订单管理模块begin
    @Select("select * from accept_info where accept_id in (select user_id from user_basic_info where user_phone = #{myphone})")
    List<AcceptInfo> find_my_accept_info(@Param("myphone") String myphone);

    @Select("select * from send_info where sender_id in (select user_id from user_basic_info where user_phone = #{myphone})")
    List<SendInfo> find_my_send_info(@Param("myphone") String myphone);


    @Insert("insert order_basic_info (sender_id,accept_id) values(#{sender_id},#{accept_id})")
    int insert_new_order(@Param("sender_id") String sendId,@Param("accept_id") String acceptId);

    @Select("select order_id from order_basic_info ORDER BY order_id DESC LIMIT 1;")
    String find_new_order_id();

    @Delete("delete from order_basic_info where order_id = #{order_id}")
    int delete_order_basic_inf(@Param("order_id") String _id);
    //订单管理模块end


}
